package org.example.wikwok.pojo;

import java.io.Serializable;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;

/**
 * follow
 * @author 
 */
public class Follow implements Serializable {
    private Integer id;

    private Integer followeruserid;

    private Integer followeduserid;

    private Timestamp followtime;

    private static final long serialVersionUID = 1L;

    public Follow(Integer followeruserid, Integer followeduserid) {
        this.followeruserid = followeruserid;
        this.followeduserid = followeduserid;
        this.followtime =new Timestamp(new Date().getTime());
    }

    public Follow(Integer id, Integer followeruserid, Integer followeduserid, Timestamp followtime) {
        this.id = id;
        this.followeruserid = followeruserid;
        this.followeduserid = followeduserid;
        this.followtime = followtime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getFolloweruserid() {
        return followeruserid;
    }

    public void setFolloweruserid(Integer followeruserid) {
        this.followeruserid = followeruserid;
    }

    public Integer getFolloweduserid() {
        return followeduserid;
    }

    public void setFolloweduserid(Integer followeduserid) {
        this.followeduserid = followeduserid;
    }

    public Timestamp getFollowtime() {
        return followtime;
    }

    public void setFollowtime(Timestamp followtime) {
        this.followtime = followtime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Follow other = (Follow) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getFolloweruserid() == null ? other.getFolloweruserid() == null : this.getFolloweruserid().equals(other.getFolloweruserid()))
            && (this.getFolloweduserid() == null ? other.getFolloweduserid() == null : this.getFolloweduserid().equals(other.getFolloweduserid()))
            && (this.getFollowtime() == null ? other.getFollowtime() == null : this.getFollowtime().equals(other.getFollowtime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFolloweruserid() == null) ? 0 : getFolloweruserid().hashCode());
        result = prime * result + ((getFolloweduserid() == null) ? 0 : getFolloweduserid().hashCode());
        result = prime * result + ((getFollowtime() == null) ? 0 : getFollowtime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", followeruserid=").append(followeruserid);
        sb.append(", followeduserid=").append(followeduserid);
        sb.append(", followtime=").append(followtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}